import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import type {LoginInfo} from '@/api/model/model'

export const useLoginEmpStore = defineStore('loginEmp', () => {
  
  const loginEmp = ref<LoginInfo>({})

  function saveLoginInfo(loginInfo:LoginInfo){
    loginEmp.value = loginInfo;
  }

  function getLoginInfo(){
    return loginEmp.value;
  }

  function clearLoginInfo(){
    loginEmp.value = {}
  }
  

  return { loginEmp, saveLoginInfo, getLoginInfo, clearLoginInfo }
}, {persist: true})